package formal.tree.recursion;

/**
 * 最长同值路径
 * @author DengYuan2
 * @create 2021-01-16 20:17
 */
public class M_687 {
    public static void main(String[] args) {
        Integer[] a ={5,5,5,5,5,null,5};
        TreeNode treeNode = TreeNode.generateTree(a);
        int res = longestUnivaluePath(treeNode);
        System.out.println(res);
    }

    /**
     * 不会-看答案也不太懂，需继续思考啊
     * @param root
     * @return
     */
    private static int path =0;
    public static int longestUnivaluePath(TreeNode root) {
        if (root==null){
            return 0;
        }
        helper(root);
        return path;
    }

    public static int helper(TreeNode root){
        return 0;
    }


}
